package com.ruoyi.zhhq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zhhq.mapper.ZhhqCanteenorderMapper;
import com.ruoyi.zhhq.domain.ZhhqCanteenorder;
import com.ruoyi.zhhq.service.IZhhqCanteenorderService;

/**
 * 餐厅订单Service业务层处理
 * 
 * @author ZLC
 * @date 2022-10-26
 */
@Service
public class ZhhqCanteenorderServiceImpl implements IZhhqCanteenorderService 
{
    @Autowired
    private ZhhqCanteenorderMapper zhhqCanteenorderMapper;

    /**
     * 查询餐厅订单
     * 
     * @param orderId 餐厅订单主键
     * @return 餐厅订单
     */
    @Override
    public ZhhqCanteenorder selectZhhqCanteenorderByOrderId(String orderId)
    {
        return zhhqCanteenorderMapper.selectZhhqCanteenorderByOrderId(orderId);
    }

    /**
     * 查询餐厅订单列表
     * 
     * @param zhhqCanteenorder 餐厅订单
     * @return 餐厅订单
     */
    @Override
    public List<ZhhqCanteenorder> selectZhhqCanteenorderList(ZhhqCanteenorder zhhqCanteenorder)
    {
        return zhhqCanteenorderMapper.selectZhhqCanteenorderList(zhhqCanteenorder);
    }

    /**
     * 新增餐厅订单
     * 
     * @param zhhqCanteenorder 餐厅订单
     * @return 结果
     */
    @Override
    public int insertZhhqCanteenorder(ZhhqCanteenorder zhhqCanteenorder)
    {
        zhhqCanteenorder.setCreateTime(DateUtils.getNowDate());
        return zhhqCanteenorderMapper.insertZhhqCanteenorder(zhhqCanteenorder);
    }

    /**
     * 修改餐厅订单
     * 
     * @param zhhqCanteenorder 餐厅订单
     * @return 结果
     */
    @Override
    public int updateZhhqCanteenorder(ZhhqCanteenorder zhhqCanteenorder)
    {
        zhhqCanteenorder.setUpdateTime(DateUtils.getNowDate());
        return zhhqCanteenorderMapper.updateZhhqCanteenorder(zhhqCanteenorder);
    }

    /**
     * 批量删除餐厅订单
     * 
     * @param orderIds 需要删除的餐厅订单主键
     * @return 结果
     */
    @Override
    public int deleteZhhqCanteenorderByOrderIds(String[] orderIds)
    {
        return zhhqCanteenorderMapper.deleteZhhqCanteenorderByOrderIds(orderIds);
    }

    /**
     * 删除餐厅订单信息
     * 
     * @param orderId 餐厅订单主键
     * @return 结果
     */
    @Override
    public int deleteZhhqCanteenorderByOrderId(String orderId)
    {
        return zhhqCanteenorderMapper.deleteZhhqCanteenorderByOrderId(orderId);
    }
}
